package com.simple.util.base.extend;

import static sun.plugin2.util.SystemUtil.getSystemProperty;

/**
 * @program: simple_tools
 * @description:
 * @author: ChenWenLong
 * @create: 2019-05-30 11:41
 **/
public class SystemUtil {

    //WINDOWS系统前缀
    private static final String OS_NAME_WINDOWS_PREFIX = "Windows";
    //用户目录
    private static final String USER_HOME_KEY = "user.home";
    private static final String USER_DIR_KEY = "user.dir";
    //JavaIO目录
    private static final String JAVA_IO_TMPDIR_KEY = "java.io.tmpdir";
    //JAVA_HOME
    private static final String JAVA_HOME_KEY = "java.home";
    //SUN公司的WINDOWS工具包
    public static final String AWT_TOOLKIT = getSystemProperty("awt.toolkit");
    //文件编码格式
    public static final String FILE_ENCODING = getSystemProperty("file.encoding");
    //文件分割路径符
    public static final String FILE_SEPARATOR = getSystemProperty("file.separator");
    //获取字体信息
    public static final String JAVA_AWT_FONTS = getSystemProperty("java.awt.fonts");
    //获取图形环境
    public static final String JAVA_AWT_GRAPHICSENV = getSystemProperty("java.awt.graphicsenv");
    //JDK中jar包的位置
    public static final String JAVA_CLASS_PATH = getSystemProperty("java.class.path");
    //Class版本号
    /**
     * JDK 1.8 = 52
     * JDK 1.7 = 51
     * JDK 1.6 = 50
     * JDK 1.5 = 49
     * JDK 1.4 = 48
     * JDK 1.3 = 47
     * JDK 1.2 = 46
     * JDK 1.1 = 45
     */
    public static final String JAVA_CLASS_VERSION = getSystemProperty("java.class.version");
    //获取用户本地临时目录
    public static final String JAVA_IO_TMPDIR = getSystemProperty(JAVA_IO_TMPDIR_KEY);
    public static final String JAVA_LIBRARY_PATH = getSystemProperty("java.library.path");
    //Java运行时名称
    public static final String JAVA_RUNTIME_NAME = getSystemProperty("java.runtime.name");
    //Java版本
    public static final String JAVA_RUNTIME_VERSION = getSystemProperty("java.runtime.version");
    public static final String JAVA_SPECIFICATION_NAME = getSystemProperty("java.specification.name");
    //Java供应商 Oracle
    public static final String JAVA_VENDOR = getSystemProperty("java.vendor");
    //Java供应商 Oracle地址
    public static final String JAVA_VENDOR_URL = getSystemProperty("java.vendor.url");
    //JDK版本号
    public static final String JAVA_VERSION = getSystemProperty("java.version");
    //JVM运行方式
    public static final String JAVA_VM_INFO = getSystemProperty("java.vm.info");
    //JVM名称
    public static final String JAVA_VM_NAME = getSystemProperty("java.vm.name");
    //JVM全称
    public static final String JAVA_VM_SPECIFICATION_NAME = getSystemProperty("java.vm.specification.name");
    //JVM供应商
    public static final String JAVA_VM_SPECIFICATION_VENDOR = getSystemProperty("java.vm.specification.vendor");
    //JVM版本
    public static final String JAVA_VM_SPECIFICATION_VERSION = getSystemProperty("java.vm.specification.version");
    //JVM供应商
    public static final String JAVA_VM_VENDOR = getSystemProperty("java.vm.vendor");
    //行分隔符
    public static final String LINE_SEPARATOR = getSystemProperty("line.separator");
    //系统处理器
    public static final String OS_ARCH = getSystemProperty("os.arch");
    //操作系统名称
    public static final String OS_NAME = getSystemProperty("os.name");
    //用户所在国家
    public static final String USER_COUNTRY =
            getSystemProperty("user.country") == null ?
                    getSystemProperty("user.region") : getSystemProperty("user.country");
    //用户使用的语言
    public static final String USER_LANGUAGE = getSystemProperty("user.language");
    //用户名称
    public static final String USER_NAME = getSystemProperty("user.name");
    //用户时区
    public static final String USER_TIMEZONE = getSystemProperty("user.timezone");


}
